public class ChouseType
{

    public enum TiKuGroup { Random, Yuwen, Lishi, Shuxue, Kexue }
    public enum NanDuGroup { Random, Easy, Middle, Hard }
    public enum TiNumGroup { Ten, Twenty, Thirty, Fourty, Fifty, NoStop }
    public enum AnsTimeGroup { Twenty, Thirty, Fourty, Fifty, Sixty }

    // Start is called before the first frame update
    //创建一个函数，根据不同的文案，返回对应的枚举值

    public static TiNumGroup GetTiNumGroup(string text)
    {
        return text switch
        {
            "10道" => TiNumGroup.Ten,
            "20道" => TiNumGroup.Twenty,
            "30道" => TiNumGroup.Thirty,
            "40道" => TiNumGroup.Fourty,
            "50道" => TiNumGroup.Fifty,
            "无限模式" => TiNumGroup.NoStop,
            _ => throw new System.Exception("Invalid TiNumGroup"),
        };
    }
    public static AnsTimeGroup GetAnsTimeGroup(string text)
    {
        return text switch
        {
            "20秒" => AnsTimeGroup.Twenty,
            "30秒" => AnsTimeGroup.Thirty,
            "40秒" => AnsTimeGroup.Fourty,
            "50秒" => AnsTimeGroup.Fifty,
            "60秒" => AnsTimeGroup.Sixty,
            _ => throw new System.Exception("Invalid AnsTimeGroup"),
        };
    }

    public static int AnsTimePrase(string model)
    {
        AnsTimeGroup res = GetAnsTimeGroup(model);
        return res switch
        {
            AnsTimeGroup.Twenty => 20,
            AnsTimeGroup.Thirty => 30,
            AnsTimeGroup.Fourty => 40,
            AnsTimeGroup.Fifty => 50,
            AnsTimeGroup.Sixty => 60,
            _ => 20,
        };
    }


     public static int TiNumPrase(string model)
    {
        TiNumGroup res = GetTiNumGroup(model);
        return res switch
        {
            TiNumGroup.Twenty => 20,
            TiNumGroup.Thirty => 30,
            TiNumGroup.Fourty => 40,
            TiNumGroup.Fifty => 50,
            TiNumGroup.Ten => 10,
            TiNumGroup.NoStop => -1,
            _ => 10,
        };
    }

}
